package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sun.org.apache.bcel.internal.generic.NEW;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.PledgeTaskVigorousCollection;
import com.sc.nft.mapper.PledgeTaskVigorousCollectionMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 质押任务-激活NFT(sc_pledge_task_vigorous_collection)数据DAO
 *
 * @author Sun
 * @since 2023-06-12 15:36:56
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class PledgeTaskVigorousCollectionDao extends ServiceImpl<PledgeTaskVigorousCollectionMapper, PledgeTaskVigorousCollection> {

    public List<PledgeTaskVigorousCollection> getListByPledgeTaskId(Long pledgeTaskId) {
        LambdaQueryWrapper<PledgeTaskVigorousCollection> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(PledgeTaskVigorousCollection::getPledgeTaskId, pledgeTaskId);
        return list(wrapper);
    }

    public PledgeTaskVigorousCollection getByIdAndPledgeTaskId(Long id, Long pledgeTaskId) {
        LambdaQueryWrapper<PledgeTaskVigorousCollection> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(PledgeTaskVigorousCollection::getId,id);
        wrapper.eq(PledgeTaskVigorousCollection::getPledgeTaskId, pledgeTaskId);
        return getOne(wrapper);
    }
}